/*
 * global_var.h
 *
 *  Created on: Nov 18, 2024
 *      Author: Vinson
 */

#ifndef INC_GLOBAL_VAR_H_
#define INC_GLOBAL_VAR_H_
#include "lowpass_filter.h"
#include "pid_control.h"
#include "gpio.h"

extern gpio_t sen_cs;
extern gpio_t drv_en;
extern gpio_t drv_cs;

extern SPI_HandleTypeDef hspi1; /* 编码器 */
extern SPI_HandleTypeDef hspi3; /* 栅极驱动器 */
extern DMA_HandleTypeDef hdma_spi1_rx;
extern DMA_HandleTypeDef hdma_spi1_tx;
extern TIM_HandleTypeDef htim1; /* pwm 输出 */

extern ADC_HandleTypeDef hadc1;
extern ADC_HandleTypeDef hadc2;

//extern lowpass_filter_t *m0_filter;
extern lowpass_filter_t *m0_lpf_angle;
extern lowpass_filter_t *m0_lpf_vel;
extern lowpass_filter_t *m0_lpf_current;
extern pid_control_t *m0_speedPid;
extern pid_control_t *m0_currentPid;
extern pid_control_t *m0_anglePid;
extern int isReadyOn;
#endif /* INC_GLOBAL_VAR_H_ */
